class Solution {
public:
	int jump(vector<int>& nums) {
		int  M = nums.size();
		int dp[M];
		dp[0] = 0;
		for (int i = 1; i<M; i++)
		{
			dp[i] = INT_MAX;
			for (int j = 0; j<i; j++)
			{
				if (nums[j] + j >= i){
					dp[i] = min(dp[i], dp[j] + 1);
				}
			}
		}
		return dp[M - 1];
	}
};